package com.aloda.controller.common;

import com.aloda.result.Result;
import com.aloda.utils.NicknameUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/common")
@Slf4j
public class CommonController {

    /**
     * 获取一个随机昵称
     * @return
     */
    @GetMapping("/nickname")
    public Result<String> getNickname(){
        String nickname = NicknameUtil.generateNickname();
        return Result.success(nickname);
    }
}
